The present invention relates generally to semiconductor microprocessors, a class of which known as microcontrollers perform selective control functions, and more particularly to a programmable microcontroller with enhanced memory capacity.
The evolution of microprocessors into complex instruments and machines has led to sophisticated, fast real-time control capability. Large microprocessors of 16 or 32 bit capability with associated interrupt handler chips, programmable timer chips, ROM and RAM chips, have been replaced in many control function instances by single chip lo microcontrollers with all peripherals embedded on the same chip with the microcontroller. Operation of the chip in an expanded mode enhances the versatility of all on-chip features.
Microcontrollers have a wide diversity of applications. In hand-held devices such as pocket pagers (beepers), the microcontroller is responsive to received characters to interpret them, produce an audible or vibratory signal to notify the user of an incoming message, and produce multiple alphanumeric messages on a suitable display such as an LCD. The microcontroller can recall from its internal memory any or all of the messages received in a given period of time. Among other instrumentation uses are those as meters and testers, capable of carrying out thousands of tests, each in a millisecond or less.
Other applications include keyboard controllers for personal computers, in which the microcontroller serves to offload many tasks formerly handled by the processor, including continuous performance of numerous diagnostic procedures and notification to the processor if a problem is detected. Personal computer applications of microcontrollers include use in modems for command interpretation and data transmission, in printer buffers for high speed dumping of data in preparation for driving the printer at the appropriate speed, and in color plotters, copiers, electronic typewriters/word processors, cable television terminal equipment, lawn sprinkling controllers, credit card phone equipment, cellular telephones, fax machines, automotive applications such as engine control modules, anti-lock braking systems, automobile suspension control, keyless entry systems, and a host of other industrial and consumer applications.
Typically, a microcontroller includes, among other things, a CPU (central processing unit), a program memory from which the CPU fetches instructions, and a data memory (also called a register file in some architectures) which is readable and writable directly by the CPU. The CPU fetches an instruction from the program memory and addresses the data memory according to an address obtained through the instruction or through an indirect register. The CPU may also operate in conjunction with certain peripherals to perform the control function, including devices such as timers, signal ports, and baud rate generators, among others.
Several addressing modes are common once the instruction is fetched. In some instances an embedded address tells the CPU which data memory location to modify with the current operation. This is a standard architecture for a microcontroller with on board (on chip) memory.
In copending U.S. patent application Ser. No. 08/026,968, filed on the same date as this application and assigned to the same assignee (hereinafter referred to as "the '968 application"), the problem of embedding an addressable memory within the microcontroller is considered. Typically, limited memory space is available in the microcontroller device, and much of it may be devoted to static RAM for scratch pad operation or register file use, or to special function registers such as I/O ports, timer and counters in the form of readable and writable registers mapped into the data memory space.
As disclosed in the '968 application, nonvolatile memory in the form lo of electrically erasable (alterable) programmable read only memory (EEPROM) is embedded as additional memory. However, EEPROMs have a very long write cycle (typically, 10 milliseconds) compared to the write cycle of static RAM (typically, 200 nanoseconds), which would necessitate overly long periods of inactivity by the CPU while each write operation is being performed in the EEPROM. In each instance, the CPU would wait for the write to be completed before it could fetch the next instruction or take the next step. To obviate this problem, according to the '968 application, EEPROM is embedded as peripheral data memory on the microcontroller chip, with its own address register and data register mapped as peripheral registers or special function registers within the normal data memory space.
Consequently, the CPU may initiate a write operation of the EEPROM via a control register, after the desired address has been written to the address register and the selected data for that address has been written to the data register. While this write operation is taking place in the peripheral EEPROM the CPU is released to execute other instructions, which is a distinct advantage, but the CPU is effectively oblivious to whatever is occurring in the write operations. That is, the processor is aware that a write operation was commenced, but not of the eruption of a problem during that operation. Left unattended, the EEPROM could have corrupted data written to it, which might deleteriously affect the intended operation of the microcontroller, and worse, possibly cause irreparable damage to the external system being controlled by the microcontroller.
Accordingly, it is a principal object of the present invention to provide a technique for detecting the writing of potentially corrupted data in the peripheral data memory, particularly EEPROM, of a microcontroller device.